using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using FarseerGames.FarseerPhysics.Dynamics;
using FarseerGames.FarseerPhysics.Collisions;

namespace StupidSpaceThing
{
	internal class DataTrainEntity : FlyingEntity
	{
		private static Model _loaded;
		private static Model _unloaded;
		private static Matrix[] _loadedTransforms;
		private static Matrix[] _unloadedTransforms;
		public static void InitModel(Model loaded, Model unloaded) {
			_loaded = loaded;
			_loadedTransforms = getTransforms(_loaded);
			_unloaded = unloaded;
			_unloadedTransforms = getTransforms(_unloaded);
		}

		public DataTrainEntity(Vector3 position)
			: base(null, position + Map.MaxHeightOffset, Quaternion.Identity, 0.002f) {
			setModel(_unloaded, _unloadedTransforms);
			DoRotateToAngle = true;
		}

		public void SetModel(bool loaded) {
			if( loaded ) {
				setModel(_loaded, _loadedTransforms);
			} else {
				setModel(_unloaded, _unloadedTransforms);
			}
		}

		public override void Update(RealGameTime gameTime) {
			/*if( colObject.Body.LinearVelocity.Length() > 0.0001f ) {
				RotateTowards(colObject.LinearVelocity + Position);
			}*/
			base.Update(gameTime);			
		}
	}
}
